<template>
  <div class="components-container">
    <ArticleView
      v-if="article"
      :article="article"
    />
  </div>
</template>

<script>
import { fetchArticle } from '@/api/article'
import ArticleView from './components/ArticleView'
import Prism from 'prismjs'
export default {
  name: 'ArticleDetail',
  components: {
    ArticleView
  },
  asyncComputed: {
    async article() {
      var ariticle_id = this.$route.params.id
      let result = await fetchArticle(ariticle_id)
      console.log('result:', result)
      // result = result.data.content
      result = result.data
      return result
    }
  },
  mounted() {
    Prism.highlightAll()
  }
}
</script>

